import request from '@/utils/request'

export function fetchList (params) {
  return request({
    url: '/post/list',
    method: 'get',
    params: params
  })
}
export function fetchListall (params) {
  return request({
    url: '/post/list/all',
    method: 'get',
    params: params
  })
}

export function fetchFocus () {
  return request({
    url: '/focus/list',
    method: 'get',
    params: {}
  })
}

export function fetchCategory () {
  return request({
    url: '/category',
    method: 'get',
    params: {}
  })
}

export function fetchFriend () {
  return request({
    url: '/friend',
    method: 'get',
    params: {}
  })
}

export function fetchSocial () {
  return request({
    url: '/social',
    method: 'get',
    params: {}
  });
}

export function fetchSiteInfo () {
  return request({
    url: '/site',
    method: 'get',
    params: {}
  })
}

export function getDetail (params) {
  return request({
    url: '/detail',
    method: 'get',
    params: params
  })
}

export function login (params) {
  return request({
    url: '/admin/login',
    method: 'post',
    params: params
  })
}
export function upLoadImg (params) {
  return request({
    url: '/upload/img',
    method: 'post',
    data: params
  })
}
export function save (params) {
  return request({
    url: '/admin/save',
    method: 'post',
    data: params
  })
}
